<template>
  <el-form label-width="80px" ref="from" :model="data">
    <el-form-item v-for="item in items" :key="item.label" :label="item.label" :prop="item.prop">
      <el-input v-if="item.type === 'input'" v-model="data[item.prop]" :placeholder="item.props.placeholder"> </el-input>
      <el-select v-if="item.type === 'select'" v-model="data[item.prop]" :placeholder="item.props.placeholder">
        <el-option v-for="i in item.props.list" :key="i.value" :label="i.label" :value="i.value"></el-option>
      </el-select>
      <el-switch v-model="data[item.prop]" v-if="item.type === 'switch'" @change="aaa"> </el-switch>
    </el-form-item>
    <slot></slot>
  </el-form>
</template>
<script>
export default {
  props: {
    items: {
      type: Array,
      default: () => []
    },
    data: Object
  },
  data() {
    return {};
  },
  methods: {
    aaa() {
      this.$emit('isshow', this.data.show);
    }
  }
};
</script>
